CheckableHandlerHolder

Define checkable holder which can be used to precheck that this handler may handle incoming State

Functions

Link copied to clipboard
abstract suspend fun checkHandleable(state: O): Boolean
Link copied to clipboard
abstract suspend fun StatesMachine<in O>.handleState(state: I): O?

Main handling of state. In case when this state leads to another State and handleState returns not null State it is assumed that chain is not completed.

Inheritors

CustomizableHandlerHolder
Link copied to clipboard

Extensions

holder
Link copied to clipboard
inline fun <I : O, O : State> StatesHandler<I, O>.holder(strict: Boolean = true): CustomizableHandlerHolder<O, O>
inline fun <I : O, O : State> StatesHandler<I, O>.holder(noinline filter: suspend (state: State) -> Boolean): CustomizableHandlerHolder<O, O>
inline fun <I : O, O : State> StatesHandler<I, O>.holder(strict: Boolean = true): CustomizableHandlerHolder<O, O>
inline fun <I : O, O : State> StatesHandler<I, O>.holder(noinline filter: suspend (state: State) -> Boolean): CustomizableHandlerHolder<O, O>
inline fun <I : O, O : State> StatesHandler<I, O>.holder(strict: Boolean = true): CustomizableHandlerHolder<O, O>
inline fun <I : O, O : State> StatesHandler<I, O>.holder(noinline filter: suspend (state: State) -> Boolean): CustomizableHandlerHolder<O, O>